package com.karonda.mqttpaho.service.impl;

import com.karonda.mqttpaho.service.MqttService;

import java.util.Arrays;

import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.stereotype.Service;

@Service
public class MqttServiceImpl implements MqttService {

    @Override
    public void message(String topic, MqttMessage message) {
//    	byte[] mess= message.getPayload();
//    	
//    	System.out.println( Arrays.toString(mess));
        System.out.println("接收消息主题:" + topic+",接收消息内容:" + new String(message.getPayload()));
//        System.out.println("接收消息Qos:" + message.getQos());
//        System.out.println("接收消息内容:" + new String(message.getPayload()));
    }
}
